<?php

namespace app\common\model;

use think\Model;

class PlatRed extends Model
{
    const PAGE_SHOW_ROWS = 10;
    /**
     * @param int $isPage       是否分页
     * @param array $condition  查询条件
     * @param string $field     查询字段
     * @param string $order     排列order顺序
     * @param int $limit        每页限制条数
     * @return \think\Paginator
     * @throws \think\exception\DbException
     */
    public function getItems($isPage = 1,$condition = [],$field = "*",$order = 'id desc',$limit = self::PAGE_SHOW_ROWS)
    {
        if($isPage) return  $this->field($field)->where($condition)->order($order)->paginate($limit);

        return  $this->field($field)->where($condition)->order($order)->limit($limit)->select();
    }
}
